﻿<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>哈工大博士新生选房系统</title>
<link href="css/login.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	if(location.href.indexOf("?r=e")>0){
		$('#hint_login').html('用户名或者密码错误！');
	}
	$('#login').click(function(){
		if($('#username').val()=="" || $('#password').val()==""){
			alert("用户名和密码不能为空！");
		}else{
			$('#myform').submit();
		}
		
	});
	$("#password").keydown(function(event){
		if(event.keyCode == 13){
			window.setTimeout("$('#login').click()",100);
		}
	});
	$('#admin_span').click(function(){
		$('#admin_radio').attr("checked","checked");
	});
	$('#student_span').click(function(){
		$('#student_radio').attr("checked","checked");
	});
});

</script>
</head>

<body>
    <form action = "UserAction!login.action" method="post" name="myform" id="myform" >
	<div id="login_center_div">
        <div id="username_div">
            <input name="user.username" id="username" type="text" style="background-color:transparent; width:100px" />
        </div>
        <div id="password_div">
            <input name="user.password" id="password" type="password" style="background-color:transparent; width:100px"/>
        </div>
        <div id="login_result"><span id="hint_login" style="color:red"></span></div>
        <div id="id_div">
        	<input type="radio" value="admin" id="admin_radio" name="user.identify"/>
        	<span id="admin_span">管理员</span> 
        	<input type="radio" value="student" id="student_radio" name="user.identify" style="margin-left:20px" checked/>
        	<span id="student_span">学生</span>
        </div>
        <div id="login_div">
        	<img name="login" id="login" src="images/login.png" style="cursor:hand"/>
        </div>
        <div id="register_div">
        	<a href="studentRegister.jsp"><img name="register" id="register" src="images/register.png"/></a>
        </div>
    </div>    
    </form>
</body>
</html>
